<template>
	<view class="fy-my-menu-list full-width flex-center">
		<view class="my-menu-list">
			<!-- <view class="my-menu-item" :style="viewMode=='day'?'border-bottom:1px solid #efefef;':'border-bottom:1px dashed #585757;'">
				<view class="content padding-tb-sm">
					<view>
						<text class="cuIcon-crownfill text-orange margin-right-xs"></text><text class="text-grey">成为永久会员</text>
					</view>
					<view class="text-gray text-xs">
						<text class="cuIcon-info margin-top-xs margin-right-xs"></text>邀请{{inviteTotal}}位好友可永久免费使用<text v-if="userinfo">(已邀请:{{currentCount}}位)</text>
					</view>
				</view>
				<view class="action">
					<button v-if="currentCount<inviteTotal" class="cu-btn round sm shadow" :class="viewMode=='day'?'bg-blue':'bg-grey'" open-type="share" @click="inviteUser">去邀请</button>
					<button v-if="currentCount>=inviteTotal" class="cu-btn round sm shadow" :class="viewMode=='day'?'bg-blue':'bg-grey'" @click="inviteUser">已完成</button>
				</view>
			</view> -->
			<!-- <view class="my-menu-item" @click="showServiceQrcode" :style="viewMode=='day'?'border-bottom:1px solid #efefef;':'border-bottom:1px dashed #585757;'">
				<view class="content">
					<text class="cuIcon-servicefill text-blue margin-right-xs"></text>
					<text class="text-grey">联系我们</text>
				</view>
				<view class="action">
					<text class="cuIcon-right margin-right-xs text-grey"></text>
				</view>
			</view> -->
			<!-- <view v-if="baseConfig==0" class="my-menu-item" @click="goMini" :style="viewMode=='day'?'border-bottom:1px solid #efefef;':'border-bottom:1px dashed #585757;'">
				<view class="content">
					<text class="cuIcon-discoverfill text-yellow margin-right-xs"></text>
					<text class="text-grey">更多好玩</text>
				</view>
				<view class="action">
					<text class="cuIcon-right margin-right-xs text-grey"></text>
				</view>
			</view> -->
			<view class="my-menu-item" @click="showAboutUs" >
				<view class="content">
					<text class="cuIcon-infofill text-grey margin-right-xs"></text>
					<text class="text-grey">关于我们</text>
				</view>
				<view class="action">
					<text class="cuIcon-right margin-right-xs text-grey"></text>
				</view>
			</view>
			
		</view>
		<view style="margin-bottom:66px;margin-top:1em;padding:0em .5em;width: 100%;border-radius: 10px;" v-if="bannerId">
			<ad :unit-id="bannerId"></ad>
		</view>
	</view>
</template>

<script>
	export default {
		name:"fy-my-menu-list",
		props:{
			bannerId:{
				type:String,
				default:null
			},
			currentCount:{
				type:Number,
				default:0
			},
			viewMode:{
				type:String,
				default:""
			},
			inviteTotal:{
				type:Number,
				default:0
			},
			userinfo:{
				type:Object,
				default:null
			},
			jumpAppId:{
				type:String,
				default:""
			},
			baseConfig:{
				type:Number,
				default:1
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			goMini(){
				if(this.jumpAppId){
					wx.navigateToMiniProgram({
					    appId: this.jumpAppId,
					    success(res) {
					      console.info(res);
					      // 打开成功
					    }
					  });
				}
				
			},
			inviteUser(){
				if(this.currentCount<this.inviteTotal){
					this.$emit("setShareInvite",1);
				}else{
					this.$emit("setShareInvite",0);
				}
				
			},
			showServiceQrcode(){
				this.$emit("showServiceQrcode",1);
			},
			showAboutUs(){
				this.$emit("showAbout",1);
			}
		}
	}
</script>

<style scoped lang="scss">
	.fy-my-menu-list {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		.my-menu-list {
			width: 95%;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			.my-menu-item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0 30rpx;
				min-height: 120rpx;
				width: 100%;
			}
		}
	}
</style>